import request from '@/utils/request'

// 工资相关API
const salary = {
  // 获取工资统计
  async getSalaryStats(params = {}) {
    const query = {}
    if (params.startDate) {
      query.startTime = `${params.startDate} 00:00:00`
    }
    if (params.endDate) {
      query.endTime = `${params.endDate} 23:59:59`
    }
    return request.get('/api/salary/stat', query)
  },
  
  // 删除计件工资记录
  async deleteType1Record(id) {
    return request.delete(`/api/work-records/type1/${id}`)
  },
  
  // 批量删除计件工资记录
  async batchDeleteType1(ids) {
    return request.delete('/api/work-records/type1/batch', ids)
  },

  // 删除特殊工资记录
  async deleteType2Record(id) {
    return request.delete(`/api/work-records/type2/${id}`)
  },
  
  // 批量删除特殊工资记录
  async batchDeleteType2(ids) {
    return request.delete('/api/work-records/type2/batch', ids)
  }
}

export default salary 